package Exercise1;

import java.util.Date;

public class Clock implements Runnable{
	
	public void run(){
		for (int i=0; i<10; i++){
			PrintClock();
			try{
				Thread.sleep(1000);
			}catch (InterruptedException e){
					
			}
		}
	}
	
	public synchronized void PrintClock(){
		Date tgl = new Date();
		System.out.println(String.format("%1$td:%1$tm:%1$tY %1$tH:%1$tM:%1$tS", tgl)); ;
	}
}
